package cn.fbs.passcontroller;

import cn.fbs.service.UserInfoService;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

public class CallBackController {

    @Autowired
    private UserInfoService userInfoService;
    @ApiOperation("订单状态-回调")
    @GetMapping("users/orderStatus")
    public Object orderStatus(String orderId,String status){
        JSONObject jsonObject = new JSONObject();
        try {
            userInfoService.insertOrderStatus(orderId,status);
            jsonObject.put("orderId",System.currentTimeMillis());
            jsonObject.put("status","0");
        }catch (Exception e){
            jsonObject.put("orderId",System.currentTimeMillis());
            jsonObject.put("status","1");
        }
        return jsonObject;

    }


}
